<template>
    <view class="container data-v-d05d154a" style="padding-bottom: 160rpx; background-color: #101113; height: 100vh">
        <home-navbar :bgColor="page.nav_color" @__l="__l" class="data-v-d05d154a" searchType="all" theme="white" :title="page.title" vueId="8dd740cc-1"></home-navbar>
        <page-render
            @__l="__l"
            class="data-v-d05d154a"
            :getNextPageCounter="getNextPageCounter"
            :homeNum="1"
            :isFixed="isFixed"
            :page="page"
            :refreshCounter="refreshCounter"
            theme="homepage"
            vueId="8dd740cc-2"
        ></page-render>
        <popup
            @__l="__l($event, { eventOpts: [['^close', [['closePopup']]]] })"
            @close="__e($event, { eventOpts: [['^close', [['closePopup']]]] })"
            class="data-v-d05d154a"
            :data-event-opts="[['^close', [['closePopup']]]]"
            :info="popupSetting"
            vueId="8dd740cc-3"
            v-if="isShowPopup"
        ></popup>
        <danmus @__l="__l" class="data-v-d05d154a" :list="danmuList" :setting="danmuSetting" vueId="8dd740cc-4" v-if="danmuSetting.is_enabled"></danmus>
        <coupon-popup
            @__l="
                __l($event, {
                    eventOpts: [
                        ['^close', [['e0']]],
                        ['^pickSuccess', [['closeCouponPopup']]]
                    ]
                })
            "
            @close="
                __e($event, {
                    eventOpts: [
                        ['^close', [['e0']]],
                        ['^pickSuccess', [['closeCouponPopup']]]
                    ]
                })
            "
            @pickSuccess="
                __e($event, {
                    eventOpts: [
                        ['^close', [['e0']]],
                        ['^pickSuccess', [['closeCouponPopup']]]
                    ]
                })
            "
            class="data-v-d05d154a"
            :data-event-opts="[
                ['^close', [['e0']]],
                ['^pickSuccess', [['closeCouponPopup']]]
            ]"
            vueId="8dd740cc-5"
            v-if="isShowCouponPopup"
        ></coupon-popup>
        <tab-bar @__l="__l" class="data-v-d05d154a" :isselected="0" vueId="8dd740cc-6"></tab-bar>
    </view>
</template>

<script>
import homeNavbar from '@/components/HomeNavbar/HomeNavbar';
import pageRender from '@/components/PageRender/PageRender';
import popup from '@/components/Popup/Popup';
import danmus from '@/components/Danmus/Danmus';
import couponPopup from '@/components/CouponPopup/CouponPopup';
import tabBar from '@/components/TabBar/tabBar';
(global.webpackJsonp = global.webpackJsonp || []).push([
    ['pages/index/index'],
    {
        '49e4': function (t, n, o) {
            'use strict';

            (function (t, n) {
                var e = o('4ea4');
                o('18ba');
                e(o('66fd'));
                var u = e(o('e860'));
                t.__webpack_require_UNI_MP_PLUGIN__ = o;
                n(u.default);
            }.call(this, o('bc2e').default, o('543d').createPage));
        },
        '9d3d': function (t, n, o) {
            'use strict';

            var e = o('c218');
            o.n(e).a;
        },
        aea9: function (t, n, o) {
            'use strict';

            o.r(n);
            var e = o('f530');
            var u = o.n(e);
            for (var i in e) {
                if (['default'].indexOf(i) < 0) {
                    (function (t) {
                        o.d(n, t, function () {
                            return e[t];
                        });
                    })(i);
                }
            }
            n.default = u.a;
        },
        c218: function (t, n, o) {},
        e860: function (t, n, o) {
            'use strict';

            o.r(n);
            var e = o('ed49');
            var u = o('aea9');
            for (var i in u) {
                if (['default'].indexOf(i) < 0) {
                    (function (t) {
                        o.d(n, t, function () {
                            return u[t];
                        });
                    })(i);
                }
            }
            o('9d3d');
            var p = o('f0c5');
            var s = Object(p.a)(u.default, e.b, e.c, false, null, 'd05d154a', null, false, e.a, void 0);
            n.default = s.exports;
        },
        ed49: function (t, n, o) {
            'use strict';

            o.d(n, 'b', function () {
                return u;
            });
            o.d(n, 'c', function () {
                return i;
            });
            o.d(n, 'a', function () {
                return e;
            });
            var e = {
                HomeNavbar: function () {
                    return o.e('components/HomeNavbar/HomeNavbar').then(o.bind(null, '3cce'));
                },
                PageRender: function () {
                    return Promise.all([o.e('common/vendor'), o.e('components/PageRender/PageRender')]).then(o.bind(null, 'b4aa'));
                },
                Popup: function () {
                    return o.e('components/Popup/Popup').then(o.bind(null, '04f0'));
                },
                Danmus: function () {
                    return o.e('components/Danmus/Danmus').then(o.bind(null, '4bc1'));
                },
                CouponPopup: function () {
                    return o.e('components/CouponPopup/CouponPopup').then(o.bind(null, '5c64'));
                }
            };
            var u = function () {
                var that = this;
                that.$createElement;
                that._self._c;
                that._isMounted ||
                    (that.e0 = function (n) {
                        that.isShowCouponPopupKey = false;
                    });
            };
            var i = [];
        },
        f530: function (t, n, o) {
            'use strict';

            (function (t) {
                Object.defineProperty(n, '__esModule', {
                    value: true
                });
                n.default = void 0;
                o('26cb');
                var e = {
                    components: {},
                    data: function () {
                        return {
                            isFixed: false,
                            scrollTop: 0,
                            popupSetting: {
                                number: ''
                            },
                            isShowPopupKey: true,
                            isShowCouponPopupKey: false,
                            danmuSetting: {},
                            danmuList: [],
                            refreshCounter: 0,
                            getNextPageCounter: 0
                        };
                    },
                    computed: {
                        page: function () {
                            return this.$store.getters.setting.box_home;
                        },
                        isShowPopup: function () {
                            var n = t.getStorageSync('popup_' + this.popupSetting.number);
                            return this.popupSetting.is_enabled && this.isShowPopupKey && !n;
                        },
                        isShowCouponPopup: function () {
                            var n = t.getStorageSync('coupon_popup' + this.$store.getters.setting.coupon_popup.number);
                            return this.$store.getters.setting.coupon_popup.is_enabled && this.isShowCouponPopupKey && !n;
                        }
                    },
                    watch: {},
                    onLoad: function (t) {
                        var that = this;
                        this.$http('/coupon/popup-list').then(function (t) {
                            if (0 !== t.data.list.length) {
                                that.isShowCouponPopupKey = true;
                            }
                        });
                        var o = t.gdt_vid;
                        var e = t.weixinadinfo;
                        if (o) {
                            var u = o.split('.')[0];
                            this.$store.commit('SET_CLICK_ID', u);
                        }
                        if (e) {
                            this.$store.commit('SET_WX_INFO', e);
                        }
                        this.$visitor.record('box_index');
                        this.getPopup();
                        this.getDanmu();
                    },
                    onPullDownRefresh: function () {
                        this.getPopup();
                        this.getDanmu();
                    },
                    onReachBottom: function () {
                        this.getNextPageCounter++;
                    },
                    onShow: function () {},
                    methods: {
                        getDanmu: function () {
                            var that = this;
                            this.$http('/danmus/home').then(function (n) {
                                that.danmuSetting = n.data.setting;
                                that.danmuList = n.data.list;
                            });
                        },
                        getPopup: function () {
                            var that = this;
                            this.$http('/setting/popup', 'GET').then(function (n) {
                                that.popupSetting = n.data.setting;
                            });
                        },
                        closePopup: function () {
                            t.setStorageSync('popup_' + this.popupSetting.number, 1);
                            this.isShowPopupKey = false;
                        },
                        closeCouponPopup: function () {
                            t.setStorageSync('coupon_popup' + this.$store.getters.setting.coupon_popup.number, 1);
                            this.isShowCouponPopupKey = false;
                        }
                    },
                    onPageScroll: function (n) {
                        this.scrollTop = n.scrollTop;
                        if (n.scrollTop > 334) {
                            this.isFixed = true;
                            t.$emit('onPageScroll', this.isFixed);
                        } else {
                            this.isFixed = false;
                            t.$emit('onPageScroll', this.isFixed);
                        }
                    }
                };
                n.default = e;
            }.call(this, o('543d').default));
        }
    },
    [['49e4', 'common/runtime', 'common/vendor']]
]);
</script>
<style>
@import './index.css';
</style>
